import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:hippo_app/values/app_value.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

import 'router_table.dart';
import 'values/color_value.dart';


void main() {
  if (Platform.isAndroid) {
    SystemChrome.setSystemUIOverlayStyle(
        const SystemUiOverlayStyle(statusBarColor: Colors.transparent));
  }
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {


    return MaterialApp(
      title: AppValue.appName,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: ColorValue.appPrimaryColor),
      ),
      locale: Locale('zh'),
      localizationsDelegates: [
        AppLocalizations.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      supportedLocales: [
        Locale('en'),
        Locale('zh')
      ],
      navigatorObservers: [FlutterSmartDialog.observer],
      home: RouterTable.launchScreenPage,
      onGenerateRoute: RouterTable.onGenerateRoute,
    );
  }
}

